package com.oauth.global.server.utils;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import com.oauth.global.client.beans.ApplicationImageUrl;
import com.oauth.service.application.registry.beans.ApplicationInfoBean;

public class GlobalUtil {

	public static List<ApplicationImageUrl> convertToImageList(
			Collection<ApplicationInfoBean> pInfoBeanList) {
		List<ApplicationImageUrl> imageUrlList = new ArrayList<ApplicationImageUrl>();
		for (ApplicationInfoBean infoBean : pInfoBeanList) {
			imageUrlList.add(convertToImage(infoBean));
		}
		return imageUrlList;
	}

	public static ApplicationImageUrl convertToImage(ApplicationInfoBean pInfoBean) {
		return new ApplicationImageUrl(pInfoBean.getIconUrl(), pInfoBean.getName());
	}
}
